3.2.56 \(\int \frac {\cos ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx\) [156]

Optimal. Leaf size=169 \[ \frac {3 x}{32 a^4}+\frac {i a}{20 d (a+i a \tan (c+d x))^5}+\frac {i}{16 d (a+i a \tan (c+d x))^4}+\frac {i}{16 a d (a+i a \tan (c+d x))^3}+\frac {i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac {i}{64 d \left (a^4-i a^4 \tan (c+d x)\right )}+\frac {5 i}{64 d \left (a^4+i a^4 \tan (c+d x)\right )} \]

[Out]

3/32*x/a^4+1/20*I*a/d/(a+I*a*tan(d*x+c))^5+1/16*I/d/(a+I*a*tan(d*x+c))^4+1/16*I/a/d/(a+I*a*tan(d*x+c))^3+1/16*
I/d/(a^2+I*a^2*tan(d*x+c))^2-1/64*I/d/(a^4-I*a^4*tan(d*x+c))+5/64*I/d/(a^4+I*a^4*tan(d*x+c))

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 169, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3568, 46, 212} \begin {gather*} -\frac {i}{64 d \left (a^4-i a^4 \tan (c+d x)\right )}+\frac {5 i}{64 d \left (a^4+i a^4 \tan (c+d x)\right )}+\frac {3 x}{32 a^4}+\frac {i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}+\frac {i a}{20 d (a+i a \tan (c+d x))^5}+\frac {i}{16 d (a+i a \tan (c+d x))^4}+\frac {i}{16 a d (a+i a \tan (c+d x))^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^2/(a + I*a*Tan[c + d*x])^4,x]

[Out]

(3*x)/(32*a^4) + ((I/20)*a)/(d*(a + I*a*Tan[c + d*x])^5) + (I/16)/(d*(a + I*a*Tan[c + d*x])^4) + (I/16)/(a*d*(
a + I*a*Tan[c + d*x])^3) + (I/16)/(d*(a^2 + I*a^2*Tan[c + d*x])^2) - (I/64)/(d*(a^4 - I*a^4*Tan[c + d*x])) + (
(5*I)/64)/(d*(a^4 + I*a^4*Tan[c + d*x]))

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps

\begin {align*} \int \frac {\cos ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx &=-\frac {\left (i a^3\right ) \text {Subst}\left (\int \frac {1}{(a-x)^2 (a+x)^6} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {\left (i a^3\right ) \text {Subst}\left (\int \left (\frac {1}{64 a^6 (a-x)^2}+\frac {1}{4 a^2 (a+x)^6}+\frac {1}{4 a^3 (a+x)^5}+\frac {3}{16 a^4 (a+x)^4}+\frac {1}{8 a^5 (a+x)^3}+\frac {5}{64 a^6 (a+x)^2}+\frac {3}{32 a^6 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=\frac {i a}{20 d (a+i a \tan (c+d x))^5}+\frac {i}{16 d (a+i a \tan (c+d x))^4}+\frac {i}{16 a d (a+i a \tan (c+d x))^3}+\frac {i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac {i}{64 d \left (a^4-i a^4 \tan (c+d x)\right )}+\frac {5 i}{64 d \left (a^4+i a^4 \tan (c+d x)\right )}-\frac {(3 i) \text {Subst}\left (\int \frac {1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{32 a^3 d}\\ &=\frac {3 x}{32 a^4}+\frac {i a}{20 d (a+i a \tan (c+d x))^5}+\frac {i}{16 d (a+i a \tan (c+d x))^4}+\frac {i}{16 a d (a+i a \tan (c+d x))^3}+\frac {i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac {i}{64 d \left (a^4-i a^4 \tan (c+d x)\right )}+\frac {5 i}{64 d \left (a^4+i a^4 \tan (c+d x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.38, size = 120, normalized size = 0.71 \begin {gather*} \frac {\sec ^4(c+d x) (100 i+200 i \cos (2 (c+d x))+15 (i+8 d x) \cos (4 (c+d x))-8 i \cos (6 (c+d x))-100 \sin (2 (c+d x))+15 \sin (4 (c+d x))+120 i d x \sin (4 (c+d x))+12 \sin (6 (c+d x)))}{1280 a^4 d (-i+\tan (c+d x))^4} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^2/(a + I*a*Tan[c + d*x])^4,x]

[Out]

(Sec[c + d*x]^4*(100*I + (200*I)*Cos[2*(c + d*x)] + 15*(I + 8*d*x)*Cos[4*(c + d*x)] - (8*I)*Cos[6*(c + d*x)] -
 100*Sin[2*(c + d*x)] + 15*Sin[4*(c + d*x)] + (120*I)*d*x*Sin[4*(c + d*x)] + 12*Sin[6*(c + d*x)]))/(1280*a^4*d
*(-I + Tan[c + d*x])^4)

________________________________________________________________________________________

Maple [A]
time = 0.29, size = 115, normalized size = 0.68

method result size
derivativedivides \(\frac {-\frac {3 i \ln \left (\tan \left (d x +c \right )-i\right )}{64}+\frac {i}{16 \left (\tan \left (d x +c \right )-i\right )^{4}}-\frac {i}{16 \left (\tan \left (d x +c \right )-i\right )^{2}}+\frac {1}{20 \left (\tan \left (d x +c \right )-i\right )^{5}}-\frac {1}{16 \left (\tan \left (d x +c \right )-i\right )^{3}}+\frac {5}{64 \left (\tan \left (d x +c \right )-i\right )}+\frac {3 i \ln \left (\tan \left (d x +c \right )+i\right )}{64}+\frac {1}{64 \tan \left (d x +c \right )+64 i}}{d \,a^{4}}\) \(115\)
default \(\frac {-\frac {3 i \ln \left (\tan \left (d x +c \right )-i\right )}{64}+\frac {i}{16 \left (\tan \left (d x +c \right )-i\right )^{4}}-\frac {i}{16 \left (\tan \left (d x +c \right )-i\right )^{2}}+\frac {1}{20 \left (\tan \left (d x +c \right )-i\right )^{5}}-\frac {1}{16 \left (\tan \left (d x +c \right )-i\right )^{3}}+\frac {5}{64 \left (\tan \left (d x +c \right )-i\right )}+\frac {3 i \ln \left (\tan \left (d x +c \right )+i\right )}{64}+\frac {1}{64 \tan \left (d x +c \right )+64 i}}{d \,a^{4}}\) \(115\)
risch \(\frac {3 x}{32 a^{4}}+\frac {5 i {\mathrm e}^{-4 i \left (d x +c \right )}}{64 a^{4} d}+\frac {5 i {\mathrm e}^{-6 i \left (d x +c \right )}}{128 a^{4} d}+\frac {3 i {\mathrm e}^{-8 i \left (d x +c \right )}}{256 a^{4} d}+\frac {i {\mathrm e}^{-10 i \left (d x +c \right )}}{640 a^{4} d}+\frac {7 i \cos \left (2 d x +2 c \right )}{64 a^{4} d}+\frac {\sin \left (2 d x +2 c \right )}{8 a^{4} d}\) \(115\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x,method=_RETURNVERBOSE)

[Out]

1/d/a^4*(-3/64*I*ln(tan(d*x+c)-I)+1/16*I/(tan(d*x+c)-I)^4-1/16*I/(tan(d*x+c)-I)^2+1/20/(tan(d*x+c)-I)^5-1/16/(
tan(d*x+c)-I)^3+5/64/(tan(d*x+c)-I)+3/64*I*ln(tan(d*x+c)+I)+1/64/(tan(d*x+c)+I))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

Fricas [A]
time = 0.42, size = 87, normalized size = 0.51 \begin {gather*} \frac {{\left (120 \, d x e^{\left (10 i \, d x + 10 i \, c\right )} - 10 i \, e^{\left (12 i \, d x + 12 i \, c\right )} + 150 i \, e^{\left (8 i \, d x + 8 i \, c\right )} + 100 i \, e^{\left (6 i \, d x + 6 i \, c\right )} + 50 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 15 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 2 i\right )} e^{\left (-10 i \, d x - 10 i \, c\right )}}{1280 \, a^{4} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x, algorithm="fricas")

[Out]

1/1280*(120*d*x*e^(10*I*d*x + 10*I*c) - 10*I*e^(12*I*d*x + 12*I*c) + 150*I*e^(8*I*d*x + 8*I*c) + 100*I*e^(6*I*
d*x + 6*I*c) + 50*I*e^(4*I*d*x + 4*I*c) + 15*I*e^(2*I*d*x + 2*I*c) + 2*I)*e^(-10*I*d*x - 10*I*c)/(a^4*d)

________________________________________________________________________________________

Sympy [A]
time = 0.33, size = 258, normalized size = 1.53 \begin {gather*} \begin {cases} \frac {\left (- 171798691840 i a^{20} d^{5} e^{32 i c} e^{2 i d x} + 2576980377600 i a^{20} d^{5} e^{28 i c} e^{- 2 i d x} + 1717986918400 i a^{20} d^{5} e^{26 i c} e^{- 4 i d x} + 858993459200 i a^{20} d^{5} e^{24 i c} e^{- 6 i d x} + 257698037760 i a^{20} d^{5} e^{22 i c} e^{- 8 i d x} + 34359738368 i a^{20} d^{5} e^{20 i c} e^{- 10 i d x}\right ) e^{- 30 i c}}{21990232555520 a^{24} d^{6}} & \text {for}\: a^{24} d^{6} e^{30 i c} \neq 0 \\x \left (\frac {\left (e^{12 i c} + 6 e^{10 i c} + 15 e^{8 i c} + 20 e^{6 i c} + 15 e^{4 i c} + 6 e^{2 i c} + 1\right ) e^{- 10 i c}}{64 a^{4}} - \frac {3}{32 a^{4}}\right ) & \text {otherwise} \end {cases} + \frac {3 x}{32 a^{4}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2/(a+I*a*tan(d*x+c))**4,x)

[Out]

Piecewise(((-171798691840*I*a**20*d**5*exp(32*I*c)*exp(2*I*d*x) + 2576980377600*I*a**20*d**5*exp(28*I*c)*exp(-
2*I*d*x) + 1717986918400*I*a**20*d**5*exp(26*I*c)*exp(-4*I*d*x) + 858993459200*I*a**20*d**5*exp(24*I*c)*exp(-6
*I*d*x) + 257698037760*I*a**20*d**5*exp(22*I*c)*exp(-8*I*d*x) + 34359738368*I*a**20*d**5*exp(20*I*c)*exp(-10*I
*d*x))*exp(-30*I*c)/(21990232555520*a**24*d**6), Ne(a**24*d**6*exp(30*I*c), 0)), (x*((exp(12*I*c) + 6*exp(10*I
*c) + 15*exp(8*I*c) + 20*exp(6*I*c) + 15*exp(4*I*c) + 6*exp(2*I*c) + 1)*exp(-10*I*c)/(64*a**4) - 3/(32*a**4)),
 True)) + 3*x/(32*a**4)

________________________________________________________________________________________

Giac [A]
time = 0.85, size = 123, normalized size = 0.73 \begin {gather*} -\frac {-\frac {60 i \, \log \left (\tan \left (d x + c\right ) + i\right )}{a^{4}} + \frac {60 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a^{4}} + \frac {20 \, {\left (3 i \, \tan \left (d x + c\right ) - 4\right )}}{a^{4} {\left (\tan \left (d x + c\right ) + i\right )}} + \frac {-137 i \, \tan \left (d x + c\right )^{5} - 785 \, \tan \left (d x + c\right )^{4} + 1850 i \, \tan \left (d x + c\right )^{3} + 2290 \, \tan \left (d x + c\right )^{2} - 1565 i \, \tan \left (d x + c\right ) - 541}{a^{4} {\left (\tan \left (d x + c\right ) - i\right )}^{5}}}{1280 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x, algorithm="giac")

[Out]

-1/1280*(-60*I*log(tan(d*x + c) + I)/a^4 + 60*I*log(tan(d*x + c) - I)/a^4 + 20*(3*I*tan(d*x + c) - 4)/(a^4*(ta
n(d*x + c) + I)) + (-137*I*tan(d*x + c)^5 - 785*tan(d*x + c)^4 + 1850*I*tan(d*x + c)^3 + 2290*tan(d*x + c)^2 -
 1565*I*tan(d*x + c) - 541)/(a^4*(tan(d*x + c) - I)^5))/d

________________________________________________________________________________________

Mupad [B]
time = 4.13, size = 90, normalized size = 0.53 \begin {gather*} \frac {3\,x}{32\,a^4}-\frac {-\frac {3\,{\mathrm {tan}\left (c+d\,x\right )}^5}{32}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^4\,3{}\mathrm {i}}{8}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^3}{2}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,1{}\mathrm {i}}{8}+\frac {47\,\mathrm {tan}\left (c+d\,x\right )}{160}-\frac {3}{10}{}\mathrm {i}}{a^4\,d\,{\left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )}^5\,\left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^2/(a + a*tan(c + d*x)*1i)^4,x)

[Out]

(3*x)/(32*a^4) - ((47*tan(c + d*x))/160 - (tan(c + d*x)^2*1i)/8 + tan(c + d*x)^3/2 + (tan(c + d*x)^4*3i)/8 - (
3*tan(c + d*x)^5)/32 - 3i/10)/(a^4*d*(tan(c + d*x) - 1i)^5*(tan(c + d*x) + 1i))

________________________________________________________________________________________